package com.ghsc.ghxc.jsb.ext

fun getTime(m: Long): String {
    if (m < 3600 * 24) { //时
        return   NumFormat(m / 60 / 60) + ":" +   NumFormat(
            m / 60 % 60) + "小时" +   NumFormat(m % 60)
    }
    return if (m >= 3600 * 24) { //天
        NumFormat2(m / 60 / 60 / 24) + "天" +   NumFormat(m / 60 / 60 % 24) + "小时"
    } else "-小时"
}

private fun NumFormat2(i: Long): String {
    return i.toString()
}


private fun NumFormat(i: Long): String {
    return if (i.toString().length < 2) {
        "0$i"
    } else {
        i.toString()
    }
}